<!DOCTYPE html>
<html>

<head>
    <include file="Share:meta" />
    <script src="../Public/plugins/jsFormat/jsFormat.js"></script>

</head>

<body oncontextmenu="self.event.returnValue=false" ondragstart="return false" class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">
        <include file="Share:header" />
        <include file="Share:left" />
        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>产品<small></small></h1>
                <ol class="breadcrumb">
                    <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                    <li class="active">新增、修改</li>
                </ol>
            </section>
            <!-- Main content -->
            <section class="content">
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title"><empty name="Think.get.tid">新增产品<else />产品详细信息</empty></h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form class="form-horizontal" action="/Product/detail" method="post" enctype="multipart/form-data">
                        <input type="hidden" name="tid" value="{$info.tid}"></input>
                        <div class="box-body">
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">名称</label>
                                <div class="col-sm-10">
                                    <input type="text" name="pname" id="inputEventCode" class="form-control" value="{$info.pname}" placeholder="" required="required" autocomplete="off">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">分类</label>
                                <div class="col-sm-10">
                                    <select name="type" id="typeId" class="form-control" required="required">
                                  <!--       <option value="0">美容项目</option>
                                        <option value="1">头发护理</option>
                                        <option value="2">染发项目</option>
                                        <option value="3">烫发项目</option> -->
                                        <volist name="list" id="vo">
                                             <option value="{$vo.code}">{$vo.value}</option>
                                        </volist>
                                    </select>
                                    <script type="text/javascript">
                                        $("#typeId").val("{$info.type}");
                                    </script>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">价格</label>
                                <div class="col-sm-10">
                                    <input type="text" name="price" id="inputPrice" class="form-control" value="{$info.price}" required="required" title="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">编号</label>
                                <div class="col-sm-10">
                                    <input type="text" name="prono" id="inputPrice" class="form-control" value="{$info.prono}" required="required" title="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">图片</label>
                                <div class="col-sm-10">
                                    <div class="btn-group">
                                        <if condition="$info.tid eq ''">
                                            <label title="上传图片" for="inputImage" class="btn btn-primary">
                                                <i class="fa fa-upload"></i>
                                                <input type="file" name="Avatar" id="inputImage" class="hide"> 上传图片
                                            </label>
                                        <else/>
                                            <img class="img-responsive" src="{$info.imgurl}" width="100px;" height="100px;" />
                                            <a href="javascript:void(0)" class="editpic">&nbsp;更换</a>
                                        </if>
                                        <span id="file"></span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">状态</label>
                                <div class="col-sm-10">
                                    <select name="is_forbit" id="is_forbit" class="form-control" required="required">
                                        <option value="0">禁用</option>
                                        <option value="1">启用</option>
                                        <option value="-1">删除</option>
                                    </select>
                                    <script type="text/javascript">
                                        $("#is_forbit").val('{$info.is_forbit}');
                                    </script>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer col-sm-offset-2">
                            <button type="submit" class="btn btn-primary">
                                <eq name="info" value="">新增
                                    <else />保存</eq>
                            </button>
                            <a class="btn btn-warning" href="/Product/plist" role="button">返回</a>
                        </div>
                        <br>
                        <!-- /.box-footer -->
                    </form>
                </div>
              
            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->
        <include file="Share:copyright" />
        <include file="Share:setting" />
    </div>
    <include file="Share:js" />
    <script type="text/javascript">
        $("#ProductManager").addClass("active");
        $("#product_list").addClass("active");

        $(function(){
            $('.editpic').click(function() {
                $('#file').after('<br/><div class="btn-group">' +
                    '<label title="上传图片" for="inputImage" class="btn btn-primary">' +
                    '<i class="fa fa-upload"></i>' +
                    '<input type="file" name="Avatar" id="inputImage" class="hide"> 上传图片' +
                    '</label> ' +
                    '</div>');
            });
        });
    </script>
</body>

</html>
